package com.mrzhiyi.demo.sb.controller;

import com.mrzhiyi.demo.sb.common.resp.Result;
import com.mrzhiyi.demo.sb.entity.Emp;
import com.mrzhiyi.demo.sb.service.IEmpService;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Kevin Liu
 * @since 2024-08-08
 */
@RestController
@RequestMapping("/emp")
public class EmpController{
    private final IEmpService empService;

    public EmpController(IEmpService empService){
        this.empService=empService;
    }

    @GetMapping("all")
    public Result<List<Emp>> all(){
        List<Emp> list=this.empService.list();
        return Result.ok(list);
    }
}
